package com.example.gamestore.service.Impl;

import com.example.gamestore.mapper.ShoppingCartMapper;
import com.example.gamestore.pojo.ShoppingCart;
import com.example.gamestore.service.ShoppingCartService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ShoppingCartServiceImpl implements ShoppingCartService {
    @Resource
    private ShoppingCartMapper shoppingCartMapper;

    @Override
    public int add(ShoppingCart shoppingCart) {
        return shoppingCartMapper.add(shoppingCart);
    }

    @Override
    public List<ShoppingCart> getByUserId(Long userId) {
        return shoppingCartMapper.getByUserId(userId);
    }

    @Override
    public void delete(Long id) {
        shoppingCartMapper.delete(id);
    }
}